﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using MINERP.MODEL.MobileMsgSend;
using MINERP.ComControls;
using MINERP.BLL.MobileMsgSend;
using MINERP.MODEL.FoundationModel;
using System.Text.RegularExpressions;


namespace MINERP.MobileMsgSend.Forms
{
    public partial class FrmMain : FrmParent
    {
        public FrmMain()
        {
            InitializeComponent();
            base.InitiAuthority();
        }

        private void treeView1_AfterSelect(object sender, TreeViewEventArgs e)
        {
            if (e.Node.Name == "noteReceive")//收件箱
            {
                // xtraTabPageReceive.Select();
                PrintxtraTabPageReceive();
            }
            else if (e.Node.Name == "noteSended")//已经发送
            {
                PrintxtraTabPageSended();

            }
            else if (e.Node.Name == "noteUnSend")//未发送
            {
                PrintxtraTabPageUnSent();
            }
            //else if (e.Node.Name == "noteSet")//设置
            //{
            //    xtraTabControlMain.SelectedTabPage = xtraTabPageSet;
            //    xtraTabPageReceive.PageVisible = false;
            //    xtraTabPageSended.PageVisible = false;
            //    xtraTabPageUnSent.PageVisible = false;
            //    xtraTabPageNewMessage.PageVisible = false;
            //    xtraTabPageSet.PageVisible = true;
            //}
            else if (e.Node.Name == "noteNew")//新建
            {
                PrintxtraTabPageNewMessage();
            }

        }

        private void simpleButtonReceive_Click(object sender, EventArgs e)
        {
            PrintxtraTabPageReceive();
        }

        private void simpleButtonSend_Click(object sender, EventArgs e)
        {
            PrintxtraTabPageUnSent();
        }

        private void simpleButtonImport_Click(object sender, EventArgs e)
        {
            FrmShopInfo frm = new FrmShopInfo(SendList);
            frm.PassTelList += new FrmShopInfo.PassList(frm_PassTelList);//显示列表
            frm.Show();
        }

        void frm_PassTelList(List<TelList> inList)
        {
            SendList = inList;
            gridControlTelLst.DataSource = inList;
            gridControlTelLst.RefreshDataSource();
        }


        private void richTextBoxContent_TextChanged(object sender, EventArgs e)
        {
            this.labelContFont.Text = richTextBoxContent.Text.Length.ToString();
        }

        private void FrmMain_Load(object sender, EventArgs e)
        {
            UserId = base.userId;
            PrintxtraTabPageUnSent();
            textEditRecordinPage.Text = intRecordInPage.ToString();
        }
        /// <summary>
        /// 收件
        /// </summary>
        private void PrintxtraTabPageReceive()
        {
            try
            {
                panelDelete.Visible = true;
                this.Cursor = Cursors.WaitCursor;
                panelPage.Visible = true;
                xtraTabControlMain.SelectedTabPage = xtraTabPageReceive;
                //xtraTabPageSended.Enabled = false;
                xtraTabPageSended.PageVisible = false;
                xtraTabPageUnSent.PageVisible = false;

                xtraTabPageNewMessage.PageVisible = false;
                xtraTabPageReceive.PageVisible = true;
                IntMessageLength = 70;//后台配置中获取
                int iCount = 0;
                gridControlReceive.DataSource = _bll.GetReceiveMessage(1, intRecordInPage, out iCount);
                intAllCount = iCount;
                //panelDelete.Location = new Point(597, 10);
            }
            catch
                (Exception ex)
            {
                MessageBox.Show("数据库连接失败，请稍后重试。", "确定", MessageBoxButtons.OK, MessageBoxIcon.Question);

            }
            finally
            {
                this.Cursor = Cursors.Default;
            }

        }
        /// <summary>
        /// 已发送
        /// </summary>
        private void PrintxtraTabPageSended()
        {
            try
            {
                this.Cursor = Cursors.WaitCursor;
                panelPage.Visible = true;
                xtraTabControlMain.SelectedTabPage = xtraTabPageSended;
                xtraTabPageReceive.PageVisible = false;
                xtraTabPageUnSent.PageVisible = false;

                xtraTabPageNewMessage.PageVisible = false;
                xtraTabPageSended.PageVisible = true;
                panelDelete.Visible = true;
                int iCount = 0;
                gridControlSended.DataSource = _bll.GetSendedMessage(1, intRecordInPage, out iCount);
                intAllCount = iCount;

               //panelDelete.Location = new Point(597, 10);
            }
            catch
                (Exception ex)
            {
                MessageBox.Show("数据库连接失败，请稍后重试。", "确定", MessageBoxButtons.OK, MessageBoxIcon.Question);

            }
            finally
            {
                this.Cursor = Cursors.Default;
            }

        }
        private void PrintxtraTabPageUnSent()
        {
            try
            {
                this.Cursor = Cursors.WaitCursor;
                panelPage.Visible = false;
                xtraTabControlMain.SelectedTabPage = xtraTabPageUnSent;
                xtraTabPageReceive.PageVisible = false;
                xtraTabPageSended.PageVisible = false;

                xtraTabPageNewMessage.PageVisible = false;
                xtraTabPageUnSent.PageVisible = true;
                panelDelete.Visible = true;


                //显示列表
                gridControlUnSendList.DataSource = _bll.GetUnSendMessage();

               // panelDelete.Location = new Point(6, 9);
            }
            catch
                (Exception ex)
            {
                MessageBox.Show("数据库连接失败，请稍后重试。", "确定", MessageBoxButtons.OK, MessageBoxIcon.Question);

            }
            finally
            {
                this.Cursor = Cursors.Default;
            }

        }
        private void PrintxtraTabPageNewMessage()
        {
            try
            {
                this.Cursor = Cursors.WaitCursor;
                panelPage.Visible = false;
                xtraTabControlMain.SelectedTabPage = xtraTabPageNewMessage;
                xtraTabPageReceive.PageVisible = false;
                xtraTabPageSended.PageVisible = false;
                xtraTabPageUnSent.PageVisible = false;

                xtraTabPageNewMessage.PageVisible = true;

                panelDelete.Visible = false;
            }
            catch
                (Exception ex)
            {
                MessageBox.Show("数据库连接失败，请稍后重试。", "确定", MessageBoxButtons.OK, MessageBoxIcon.Question);

            }
            finally
            {
                this.Cursor = Cursors.Default;
            }
        }
        private void textEditRecordinPage_KeyDown(object sender, KeyEventArgs e)
        {
            if (e.KeyValue == (int)Keys.Enter)
            {
                intRecordInPage = Math.Abs(Convert.ToInt32(textEditRecordinPage.Text));
                textEditRecordinPage.Text = intRecordInPage.ToString(); ;
            }
        }
        private void simpleButtonSendTo_Click(object sender, EventArgs e)
        {
            this.simpleButtonSendTo.Enabled = false;
            try
            {
                DateTime bookTime = new DateTime();
                if (string.IsNullOrEmpty(this.dateEdit1.Text))
                {
                    bookTime = Convert.ToDateTime("2000-01-01");
                }
                else
                {
                    bookTime = Convert.ToDateTime(dateEdit1.DateTime);
                }
                int type = Convert.ToInt32(this.comboBoxEditPriority.SelectedIndex);
                bool rtnBool = false;
                try
                {
                    rtnBool = _bll.SendToDB(SendList, this.richTextBoxContent.Text, type, bookTime, 0, 0, userId);
                }
                catch (Exception ex)
                {
                    MessageBox.Show(ex.Message, "提示", MessageBoxButtons.OK, MessageBoxIcon.Information);
                }
                if (rtnBool)
                {
                    MessageBox.Show("消息添加成功", "提示", MessageBoxButtons.OK, MessageBoxIcon.Information);
                    SendList = new List<TelList>();
                }
            }
            catch (Exception exx)
            {

                MessageBox.Show(exx.Message, "提示", MessageBoxButtons.OK, MessageBoxIcon.Information);
            }
            finally
            {
                this.simpleButtonSendTo.Enabled = true;
            }
        }


        /// <summary>
        /// 前一页
        /// 
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void simpleButtonPriview_Click(object sender, EventArgs e)
        {
            try
            {
                this.Cursor = Cursors.WaitCursor;
                if (intCurrPage > 1)
                {
                    intCurrPage -= 1;
                }
                else
                {
                    intCurrPage = 1;
                }
                if (xtraTabPageReceive.PageVisible)
                {
                    int iCount = 0;
                    gridControlReceive.DataSource = _bll.GetReceiveMessage(intCurrPage, intRecordInPage, out iCount);
                    intAllCount = iCount;
                }
                else if (xtraTabPageSended.PageVisible)
                {
                    int iCount = 0;
                    gridControlSended.DataSource = _bll.GetSendedMessage(intCurrPage, intRecordInPage, out iCount);
                    intAllCount = iCount;
                }
            }
            catch
                (Exception ex)
            {
                MessageBox.Show("数据库连接失败，请稍后重试。", "确定", MessageBoxButtons.OK, MessageBoxIcon.Question);

            }
            finally
            {
                this.Cursor = Cursors.Default;
            }
        }
        private void simpleButtonFrist_Click(object sender, EventArgs e)
        {
            try
            {
                this.Cursor = Cursors.WaitCursor;
                this.intCurrPage = 1;
                if (xtraTabPageReceive.PageVisible)
                {
                    int iCount = 0;

                    gridControlReceive.DataSource = _bll.GetReceiveMessage(intCurrPage, intRecordInPage, out iCount);
                    intAllCount = iCount;
                }
                else if (xtraTabPageSended.PageVisible)
                {
                    int iCount = 0;
                    gridControlSended.DataSource = _bll.GetSendedMessage(intCurrPage, intRecordInPage, out iCount);
                    intAllCount = iCount;
                }
            }
            catch
                (Exception ex)
            {
                MessageBox.Show("数据库连接失败，请稍后重试。", "确定", MessageBoxButtons.OK, MessageBoxIcon.Question);

            }
            finally
            {
                this.Cursor = Cursors.Default;
            }
        }
        private void simpleButtonNextPage_Click(object sender, EventArgs e)
        {
            try
            {
                this.Cursor = Cursors.WaitCursor;
                if (intCurrPage < intAllPage)
                {
                    intCurrPage = intCurrPage + 1;
                }
                else
                {
                    intCurrPage = intAllPage;
                }
                if (xtraTabPageReceive.PageVisible)
                {
                    int iCount = 0;
                    gridControlReceive.DataSource = _bll.GetReceiveMessage(intCurrPage, intRecordInPage, out iCount);
                    intAllCount = iCount;
                }
                else if (xtraTabPageSended.PageVisible)
                {
                    int iCount = 0;
                    gridControlSended.DataSource = _bll.GetSendedMessage(intCurrPage, intRecordInPage, out iCount);
                    intAllCount = iCount;
                }
            }
            catch
                (Exception ex)
            {
                MessageBox.Show("数据库连接失败，请稍后重试。", "确定", MessageBoxButtons.OK, MessageBoxIcon.Question);

            }
            finally
            {
                this.Cursor = Cursors.Default;
            }
        }
        private void simpleButtonLast_Click(object sender, EventArgs e)
        {
            try
            {
                this.Cursor = Cursors.WaitCursor;
                this.intCurrPage = intAllPage;
                if (xtraTabPageReceive.PageVisible)
                {
                    int iCount = 0;

                    gridControlReceive.DataSource = _bll.GetReceiveMessage(intCurrPage, intRecordInPage, out iCount);
                    intAllCount = iCount;
                }
                else if (xtraTabPageSended.PageVisible)
                {
                    int iCount = 0;
                    gridControlSended.DataSource = _bll.GetSendedMessage(intCurrPage, intRecordInPage, out iCount);
                    intAllCount = iCount;
                }
            }
            catch
                (Exception ex)
            {
                MessageBox.Show("数据库连接失败，请稍后重试。", "确定", MessageBoxButtons.OK, MessageBoxIcon.Question);

            }
            finally
            {
                this.Cursor = Cursors.Default;
            }
        }
        private void textEditCurrPage_KeyDown(object sender, KeyEventArgs e)
        {
            if (e.KeyValue == (int)Keys.Enter)
            {
                int inPage = int.Parse(textEditCurrPage.Text);
                if (inPage <= this.intAllPage)
                {
                    intCurrPage = inPage;
                }
                else
                {
                    intCurrPage = intAllPage;
                }
                if (xtraTabPageReceive.PageVisible)
                {
                    int iCount = 0;

                    gridControlReceive.DataSource = _bll.GetReceiveMessage(intCurrPage, intRecordInPage, out iCount);
                    intAllCount = iCount;
                }
                else if (xtraTabPageSended.PageVisible)
                {
                    int iCount = 0;
                    gridControlSended.DataSource = _bll.GetSendedMessage(intCurrPage, intRecordInPage, out iCount);
                    intAllCount = iCount;
                }
            }
        }
        /// <summary>
        /// 选择
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void simpleButtonAllSelect_Click(object sender, EventArgs e)
        {
            int iCount = 0;
            if (xtraTabPageReceive.PageVisible)
            {
                iCount = gridViewReceive.RowCount;
                for (int i = 0; i < iCount; i++)
                {
                    SMReceive_Info info = (SMReceive_Info)gridViewReceive.GetRow(i);
                    info.isSelect = true;
                    gridViewReceive.SetRowCellValue(i, "isSelect", true);
                }

            }
            else if (xtraTabPageSended.PageVisible)
            {
                iCount = gridViewSended.RowCount;
                for (int i = 0; i < iCount; i++)
                {
                    SMSended_Info info = (SMSended_Info)gridViewSended.GetRow(i);
                    info.isSelect = true;
                    gridViewSended.SetRowCellValue(i, "isSelect", true);
                }
            }
            else if (xtraTabPageUnSent.PageVisible)
            {
                iCount = gridViewUnSendList.RowCount;
                for (int i = 0; i < iCount; i++)
                {
                    SMSend_Info info = (SMSend_Info)gridViewUnSendList.GetRow(i);
                    info.isSelect = true;
                    gridViewUnSendList.SetRowCellValue(i, "isSelect", true);
                }
            }
        }
        /// <summary>
        /// 删除记录
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void simpleButtonDelete_Click(object sender, EventArgs e)
        {
            if (DialogResult.OK == MessageBox.Show("确认删除选定的记录吗？", "确定", MessageBoxButtons.OKCancel, MessageBoxIcon.Question))
            {
                try
                {
                    this.Cursor = Cursors.WaitCursor;
                    int iCount = 0;
                    if (xtraTabPageReceive.PageVisible)
                    {

                        List<SMReceive_Info> delList = new List<SMReceive_Info>();
                        for (int i = gridViewReceive.RowCount - 1; i >= 0; i--)
                        {
                            SMReceive_Info info = (SMReceive_Info)gridViewReceive.GetRow(i);
                            if (info.isSelect)
                            {
                                gridViewReceive.DeleteRow(i);
                                delList.Add(info);
                            }
                        }
                        _bll.DeleteSMReceive(delList);

                    }
                    else if (xtraTabPageSended.PageVisible)
                    {

                        List<SMSended_Info> delList = new List<SMSended_Info>();
                        for (int i = gridViewSended.RowCount - 1; i >= 0; i--)
                        {
                            SMSended_Info info = (SMSended_Info)gridViewSended.GetRow(i);
                            if (info.isSelect)
                            {
                                delList.Add(info);
                                gridViewSended.DeleteRow(i);
                            }
                        }
                        _bll.DeleteSMSended(delList);
                    }
                    else if (xtraTabPageUnSent.PageVisible)
                    {

                        List<SMSend_Info> delList = new List<SMSend_Info>();
                        for (int i = gridViewUnSendList.RowCount - 1; i >= 0; i--)
                        {
                            SMSend_Info info = (SMSend_Info)gridViewUnSendList.GetRow(i);
                            if (info.isSelect)
                            {
                                delList.Add(info);
                                gridViewUnSendList.DeleteRow(i);
                            }
                        }
                        _bll.DeleteSMSend(delList);
                    }
                }
                catch (Exception ex)
                {
                    MessageBox.Show("确认删除选定的记录吗？", "确定", MessageBoxButtons.OK, MessageBoxIcon.Question);
                }
                finally
                {
                    this.Cursor = Cursors.Default;
                }
            }
        }
        /// <summary>
        /// 反选
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void simpleButtonFanxuan_Click(object sender, EventArgs e)
        {
            int iCount = 0;
            if (xtraTabPageReceive.PageVisible)
            {
                iCount = gridViewReceive.RowCount;
                for (int i = 0; i < iCount; i++)
                {
                    SMReceive_Info info = (SMReceive_Info)gridViewReceive.GetRow(i);
                    if (info.isSelect)
                    {
                        info.isSelect = false;
                        gridViewReceive.SetRowCellValue(i, "isSelect", false);
                    }
                    else
                    {
                        info.isSelect = true;
                        gridViewReceive.SetRowCellValue(i, "isSelect", true);
                    }

                }

            }
            else if (xtraTabPageSended.PageVisible)
            {
                iCount = gridViewSended.RowCount;
                for (int i = 0; i < iCount; i++)
                {
                    SMSended_Info info = (SMSended_Info)gridViewSended.GetRow(i);
                    if (info.isSelect)
                    {
                        info.isSelect = false;
                        gridViewSended.SetRowCellValue(i, "isSelect", false);
                    }
                    else
                    {
                        info.isSelect = true;
                        gridViewSended.SetRowCellValue(i, "isSelect", true);
                    }
                }
            }
            else if (xtraTabPageUnSent.PageVisible)
            {
                iCount = gridViewUnSendList.RowCount;
                for (int i = 0; i < iCount; i++)
                {

                    SMSend_Info info = (SMSend_Info)gridViewUnSendList.GetRow(i);
                    if (info.isSelect)
                    {
                        info.isSelect = false;
                        gridViewUnSendList.SetRowCellValue(i, "isSelect", false);
                    }
                    else
                    {
                        info.isSelect = true;
                        gridViewUnSendList.SetRowCellValue(i, "isSelect", true);
                    }
                }
            }
        }
        /// <summary>
        ///  全不选
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void simpleButtonAllUnSelect_Click(object sender, EventArgs e)
        {
            int iCount = 0;
            if (xtraTabPageReceive.PageVisible)
            {
                iCount = gridViewReceive.RowCount;
                for (int i = 0; i < iCount; i++)
                {
                    SMReceive_Info info = (SMReceive_Info)gridViewReceive.GetRow(i);
                    info.isSelect = false;
                    gridViewReceive.SetRowCellValue(i, "isSelect", false);
                }

            }
            else if (xtraTabPageSended.PageVisible)
            {
                iCount = gridViewSended.RowCount;
                for (int i = 0; i < iCount; i++)
                {
                    SMSended_Info info = (SMSended_Info)gridViewSended.GetRow(i);
                    info.isSelect = false;
                    gridViewSended.SetRowCellValue(i, "isSelect", false);
                }
            }
            else if (xtraTabPageUnSent.PageVisible)
            {
                iCount = gridViewUnSendList.RowCount;
                for (int i = 0; i < iCount; i++)
                {
                    SMSend_Info info = (SMSend_Info)gridViewUnSendList.GetRow(i);
                    info.isSelect = false;
                    gridViewUnSendList.SetRowCellValue(i, "isSelect", false);
                }
            }
        }

        //public List<string> SendList = new List<string>();
        public List<TelList> SendList = new List<TelList>();
        public int IntMessageLength = 0;
        public int UserId = 0;
        private MobileMsgSendBLL _bll = new MobileMsgSendBLL();

        int _intAllPage;//页数
        int intRecordInPage = 100;//每页记录数
        int _intAllCount;//总记录数

        int _intCurrPage;//当前页数
        public int intAllCount
        {
            set
            {
                _intAllCount = value;
                intAllPage = value / intRecordInPage;
                int intVal = value % intRecordInPage;
                if (intVal > 0)
                {
                    intAllPage = intAllPage + 1;
                }
                this.textEditAllCount.Text = value.ToString();
            }
            get
            {
                return _intAllCount;
            }
        }

        public int intCurrPage
        {
            set
            {
                _intCurrPage = value;
                this.textEditCurrPage.Text = value.ToString();
            }
            get
            {
                return _intCurrPage;
            }
        }
        public int intAllPage
        {
            set
            {
                _intAllPage = value;
                this.textEditAllPage.Text = value.ToString();
            }
            get
            {
                return _intAllPage;
            }
        }

        private void simpleButtonAddSendTo_Click(object sender, EventArgs e)
        {
            FrmLinxiren frm = new FrmLinxiren();
            frm.PassTelStr += new FrmLinxiren.PassString(frm_PassTelStr);
            frm.ShowDialog();
        }

        void frm_PassTelStr(List<string> strList)
        {

            //string name = str.Split('|')[0];
            //string tel = str.Split('|')[1];
            int intSucessCount = 0;
            int intCount = strList.Count;
            int intErr = 0;
            foreach (string str in strList)
            {
                TelList temp=SendList.FirstOrDefault(p => p.Tel == str);
                if (temp == null)
                {
                      Regex rex = new Regex("[0-9]+");
                      Match ma = rex.Match(str);

                    if ((str.Trim().Length == 11 || str.Trim().Length == 7 || str.Trim().Length == 8)&&ma.Success)
                    {
                      

                        SendList.Add(new TelList() { SendTo = "临时联系人", Tel = str });
                        intSucessCount++;
                    }
                    else
                    {
                        intErr++;
                    }
                }
               
            }
           
            gridControlTelLst.DataSource = SendList;
            gridControlTelLst.RefreshDataSource();
            MessageBox.Show("成功导入" + intSucessCount + "个临时联系人，有" + (intCount - intSucessCount)+ "个重复号码已过滤掉，有"+intErr+"个错误号码已过滤", "确定", MessageBoxButtons.OK, MessageBoxIcon.Question);

        }

        private void simpleButtonClear_Click(object sender, EventArgs e)
        {
            this.richTextBoxContent.Text = "";
        }

        private void simpleButtondeleteLian_Click(object sender, EventArgs e)
        {
            foreach (int row in gridViewTelList.GetSelectedRows())
            {
                TelList tel = (TelList)gridViewTelList.GetRow(row);
                SendList.Remove(tel);
            }
            gridControlTelLst.RefreshDataSource();
        }

        private void comboBoxEditPriority_Closed(object sender, DevExpress.XtraEditors.Controls.ClosedEventArgs e)
        {
            if (comboBoxEditPriority.SelectedIndex == 0)
            {
                dateEdit1.Enabled = false;
            }
            else
            {
                dateEdit1.Enabled = true;
            }
        }

        private void gridViewUnSendList_CustomDrawCell(object sender, DevExpress.XtraGrid.Views.Base.RowCellCustomDrawEventArgs e)
        {
            if (e.RowHandle >= 0)
            {
                if (e.Column.Name=="Priority")
                {
                    if (e.CellValue.ToString() == "0")
                    {
                        e.DisplayText = "即时发送";
                    }
                    else if (e.CellValue.ToString() == "1")
                    {
                        e.DisplayText = "定时发送";
                    }
                }
            }
        }

        private void gridViewSended_CustomDrawCell(object sender, DevExpress.XtraGrid.Views.Base.RowCellCustomDrawEventArgs e)
        {
            if (e.RowHandle >= 0)
            {
                if (e.Column.Name == "Type")
                {
                    if (e.CellValue.ToString() == "0")
                    {
                        e.DisplayText = "即时发送";
                    }
                    else if (e.CellValue.ToString() == "1")
                    {
                        e.DisplayText = "定时发送";
                    }
                }
            }
        }

        private void simpleButtonSelect_Click(object sender, EventArgs e)
        {
           
            if (xtraTabPageReceive.PageVisible)
            {
                FrmSearchReceive frm = new FrmSearchReceive();
                frm.PostSqlStr += new FrmSearchReceive.PostStr(frm_PostSqlStrReceive);
                frm.Show();
                
            }
            else if (xtraTabPageSended.PageVisible)
            {
                FrmSearchSended frm = new FrmSearchSended();
                frm.PostSqlStr += new FrmSearchSended.PostStr(frm_PostSqlStrSended);
                frm.Show();
            }
            else if (xtraTabPageUnSent.PageVisible)
            {
                
                FrmSearchUnSend frm = new FrmSearchUnSend();
                frm.PostSqlStr += new FrmSearchUnSend.PostStr(frm_PostSqlStrUnSend);
                frm.Show();
            }
          
        }

        void frm_PostSqlStrUnSend(string inStr)
        {
            List<SMSend_Info> sendList = _bll.GetSendBycondition(inStr);
            

            gridControlUnSendList.DataSource = sendList;
            gridControlUnSendList.RefreshDataSource();
        }
        void frm_PostSqlStrSended(string inStr)
        {
            List<SMSended_Info> sendedList = _bll.GetSendedByCondition(inStr);
         
            gridControlSended.DataSource = sendedList;
            gridControlSended.RefreshDataSource();
        }
        void frm_PostSqlStrReceive(string inStr)
        {
            List<SMReceive_Info> sendedList = _bll.GetReceiveByCondition(inStr);
            gridControlReceive.DataSource = sendedList;
            gridControlReceive.RefreshDataSource();
        }
































    }
}
